/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Raytracing.Shaders;

import java.awt.Graphics2D;
import processing.core.PApplet;
import processing.core.PGraphics;
import processing.core.PGraphicsJava2D;
import processing.core.PImage;

/**
 *
 * @author Matt
 */
public class PolkaDots extends ImageGenerator{

    PImage diffuse;
    int res;
    
    public PolkaDots(PApplet parent, int res){
        this.res = res;
        PGraphics pg = parent.createGraphics(res, res,PApplet.JAVA2D);
        Graphics2D pg2 = ((PGraphicsJava2D)pg).g2;
        
        pg.smooth();
        pg.beginDraw();
        pg.background(250);
        pg.stroke(1);
        pg.fill(1);

        for (int i =0; i < 10; i++){
        
            pg.ellipse((int)(Math.random()*res),(int)(Math.random()*res),50,50);
        }
            
        pg.endDraw();
        
        diffuse = pg.get();  
    }
    
    public PImage getDiffuse() {
            return diffuse;

    }
    
    
    
}
